<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>倒计时跳转页面</title>
		
	</head>
	<body id="countdown">
		<input type="button"  value="点击倒计时" onclick="timer()" />
		<script type="text/javascript">
			var time=10;
			function timer(){
				time--;
				document.getElementById("countdown").innerHTML="还有"+ time +"秒，回到百度页面";
				if(time==0){
				location.href="https://www.baidu.com/";
				}
				setTimeout("timer()",1000)
				
			}
		</script>
	</body>
</html>
